<?php
$objRequest = $this->_request;
$strAction	= $objRequest->getParam('action', '');
$intType	= $objRequest->getParam('type', 0);
$strValue	= $objRequest->getParam('value', 0);
$strName	= $objRequest->getParam('name', null);
$strOptAll	= $objRequest->getParam('optall', 'Tất cả');
$strAddr	= $objRequest->getParam('addr', null);
$objCommon	= new Ecore_Common();
switch($intType) {
	case 1:
		$this->view->data = $objCommon->getProvince($strValue);
		break;
	case 2:
		$this->view->data = $objCommon->getDistrict((int)$strValue);
		break;
}
$this->view->action	= $strAction;
$this->view->type	= $intType;
$this->view->name	= $strName;
$this->view->optall	= $strOptAll;
$this->view->addr	= $strAddr;
$objView	= Zend_Registry::get('objView');
$strFetch	= $objView->fetch('ajax/location.tpl');
$arrJson	= array('data'=>$strFetch);
echo $objRequest->getParam('callback') . '(' . Zend_Json::encode($arrJson) . ')';
exit();